using System;
using System.Collections.Generic;
using System.Text;
using Objects;

namespace DAL
{
    public class DALDanhSachChoDuyet
    {
        public List<DanhSachChoDuyet> GetAllItem(int TrangThaiDuyet)
        {
            List<DanhSachChoDuyet> ListDanhSachChoDuyet = new List<DanhSachChoDuyet>();

            clsDataAccess acc = new clsDataAccess();

            string[] sname = new string[] { "@Status" };
            string[] vname = new string[] { TrangThaiDuyet.ToString() };
            System.Data.DataSet ds = acc.CommandSelect("DanhSachChoduyet_GetAllItem", sname, vname);

            DanhSachChoDuyet Item = new DanhSachChoDuyet();

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                System.Data.DataRow dr = ds.Tables[0].Rows[i];
                ListDanhSachChoDuyet.Add((Item.Populate(dr)));
            }
            return ListDanhSachChoDuyet;
        }
    }
}
